import React, { Component } from 'react';
import { Provider } from 'react-redux'
import { BrowserRouter, Route } from 'react-router-dom'
import Header from './components/header/index'
import Home from './page/home/index'
import Detail from './page/detail/loadable'
import Login from './page/login/index'
import Write from './page/write/index'
import store from './store'

class App extends Component {
  render() {
    return (
      <Provider store={store}>

        <BrowserRouter>
          <div>
            <Header></Header>
            <Route path="/" exact component={Home}></Route>
            <Route path="/detail/:id" exact component={Detail}></Route>
            <Route path="/login" exact component={Login}></Route>
            <Route path="/write" exact component={Write}></Route>
          </div>
        </BrowserRouter>

      </Provider>
    );
  }
}

export default App;
